using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Management;
 
namespace WMI
{
	/// <summary>
	/// Summary description for ComputerDetails.
	/// </summary>
	public class IsScannerConnected 
	{
		protected ManagementScope Scope;

		private ManagementScope CreateScope()
		{
			ManagementScope s;
			s = new ManagementScope("\\\\localhost\\root\\cimv2");
			return s;
		}
		
		private ManagementObjectSearcher CreateSearcher(string SelectString)
		{
			SelectQuery selectQuery = new SelectQuery(SelectString);
			ManagementObjectSearcher searcher = new ManagementObjectSearcher(Scope,selectQuery);
			return searcher;
		}
		
		private void Main(object sender, System.EventArgs e)
		{
			ManagementObjectSearcher searcher = CreateSearcher("Win32_DiskDrive");
			foreach (ManagementObject DiskDrive in searcher.Get()) 
			{
				//(string)DiskDrive["Tag"]
			}
		}
	}
}
